home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / cisco / tcpf.doc < prev    next >
Text File  |  1992-08-07  |  2KB  |  54 lines

  1. This program is designed to read and write from standard input and
  2. output to a raw TCP socket.  The specific application is sending data
  3. to printers attached to a terminal server's serial or parallel ports,
  4. or stuffing a file at a gateway or terminal server.
  5.  
  6. Syntax:
  7.     tcpf <switches> hostname port-number
  8.  
  9.     Switches:
  10.         -d    debugging output
  11.         -e    convert eof in input to ^D on output
  12.         -r      convert LF on input to CRLF on output
  13.         -t[nn]    timeout mode
  14.         -w[nn]    wait for open mode
  15.  
  16. This program may be used in a shell script.  The following example is
  17. of a "print" command that sends text to a PostScript printer.
  18.  
  19.  /usr/local/bin/lptops -2 -o -ntr $* | /usr/local/bin/tcpf -e chaff 4008 &
  20.  
  21. In a shared printer environment, multiple systems may be trying to connect
  22. to a particular printer.  In this case, you may wish to use the -w switch
  23. to cause tcpf to NOT give up immediately if a connection attempt fails.
  24. Instead, tcpf will continue to try every second to open connection,
  25. until the full timeout (defaults to 5 minutes) has elapsed.
  26.  
  27. It may also be used to drive our boxes from scripts running on dustbin.
  28. The switch, -t ("timeout"), is used to do this.  With -t specified, it no
  29. longer gives up when eof in either direction is encountered, but will give
  30. up when eof in both directions, or after 5 minutes of inactivity.
  31.  
  32. To use it to stuff a file at wilma, for instance, use the command line:
  33.  
  34.     tcpf -t5 wilma 23 <doit
  35.  
  36. where the file doit contains, for instance:
  37.  
  38.     floozy^M
  39.     ena
  40.     floozy^M
  41.     ping
  42.     ip^Mnit^M100^M^M^M^M
  43.     disa
  44.     exit
  45.  
  46. This script will log onto wilma, get into enable mode, then send 100 pings
  47. aimed at nit.  Output from wilma will be delivered back to the initiator.
  48.  
  49. Note that the ^M's in this message must be actuall control-M's in the file --
  50. most of the parsing uses 015 as the line terminator, and I haven't trained
  51. tcpf to do anything exotic like deal with NVT or CRLF issues.  It turns
  52. out the exec.c uses 015 or 012 as a line terminator, so the some of the
  53. commands can have normal newlines at the end.
  54.